package cn.com.w.simple.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class LoginController {

    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public String login(){

        System.out.println(">>>>>>>>进入LoginController.login()方法");
        System.out.println(">>>>>>>>重定向到 main.html");

        return "redirect:main.html";
    }


    @RequestMapping(value = "/toMain", method = RequestMethod.POST)
    public String toMain(){

        System.out.println(">>>>>>>>进入LoginController.toMain()方法");
        System.out.println(">>>>>>>>重定向到 main.html");

        return "redirect:main.html";
    }

    @RequestMapping(value ="/toError", method = RequestMethod.POST)
    public String toError(){

        System.out.println(">>>>>>>>进入LoginController.toError()方法");
        System.out.println(">>>>>>>>重定向到 error.html");

        return "redirect:error.html";
    }


}
